//
//  UIView+CustomeLine.m
//  VeryGreat
//
//  Created by apple on 2017/5/23.
//  Copyright © 2017年 JInShang. All rights reserved.
//

#import "UIView+CustomeLine.h"
#define SelfWide self.bounds.size.width
#define SelfHigh self.bounds.size.height

 

@implementation UIView (CustomeLine)
//上面的横线
- (void)toupLine:(UIColor *)lineColor andLineHigh:(NSInteger)high{
    
    UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SelfWide, high)];
    lineView.backgroundColor = lineColor;
    [self addSubview:lineView];
//    self.lineView_top = lineView;
}
//下面的横线
- (void)downLine:(UIColor *)lineColor andLineHigh:(NSInteger)high{
    
    UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, SelfHigh - high, SelfWide, high)];
    lineView.backgroundColor = lineColor;
    [self addSubview:lineView];
//    self.lineView_down = lineView;
}
//左面的横线
- (void)leftLine:(UIColor *)lineColor andLineWide:(NSInteger)wide{

    UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, wide, SelfHigh)];
    lineView.backgroundColor = lineColor;
    [self addSubview:lineView];
//    self.lineView_left = lineView;
}
//右面的横线
- (void)rightLine:(UIColor *)lineColor andLineWide:(NSInteger)wide{
    
    UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(SelfWide - wide, 0, wide, SelfHigh)];
    lineView.backgroundColor = lineColor;
    [self addSubview:lineView];
//    self.lineView_right = lineView;
}

- (void)hideLineView{

    for (UIView *view in self.subviews) {
        if (view.width == 2 || view.height == 2) {
            [view removeFromSuperview];
        }
    }
}

@end
